﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
    <title>Make Class</title>
    <script src="jquery.min.js" type="text/javascript"></script>
    <script language="JavaScript">
        $(document).ready(function () {
            document.bgColor = '#EFEFEF'
            var Qnum = 0
            

            $("span").hide();
            $("input#addStudent").click(function () {
                Qnum = Qnum + 1
                $('span#Qhere').before(Qnum + ")");
                $('#templateform .stud').clone(false).insertBefore('span#Qhere').show("fast");
                //$('span#stud:first').show("fast");
            });

            $("#results").show();
            //$("input#send").click(function () {
	        //    console.debug("gsdfkj");
            //    var fields = $(":input").serializeArray();
            //    $("#results").empty();
            //    var formData = ""
            //    jQuery.each(fields, function (i, field) {
            //        $("#results").append(field.name + "," + field.value + "/n ");
            //        formData = formData + field.name + "," + field.value + ""
            //    });
            //    var callback = function(data){
	        //      console.debug("got data:" + data);  
            //    }
            //    console.debug(formData);
            //    $.post("http:\\post", formData, callback,"json");
            //});
        });
		
		function checkForm(){
			var badNodes = $("input[required=1]:visible").each(function(){
				$(this).css("border","solid black 1px");
			}).filter(function(){
				return $(this).val() == "";
			});
			if ( badNodes.length > 0){
				badNodes.css("border","red solid 2px");
				return false;
			}else{
				return true;
			}
		}
    </script>
</head>
<body lang="en-US" dir="LTR">
    <form id="Sform" action="classSubmit.html" method="post" onsubmit="return checkForm();">
    	<!-- Class name:
    	<input type="TEXT" name="classname" size="20" style="width: 1.71in; height: 0.25in">
    	<br> -->
    	Add Students:
    	<input type="button" id="addStudent" value="Add" size="20" style="width: .75in; height: 0.25in">
    	<br />
    	<span id="Qhere">Qhere</span>
    	* = Required
    	<br />
    	<input type="submit" id="send" action="http:\\post" method="post" value="Submit" style="width: 0.71in; height: 0.37in">
    </form>
    
    <form id="templateform" action="">
    
    <span class="stud">
        Student First Name:<input type="TEXT" name="StudentFirstName[]" required="1" size="20" style="width: 6.0in; height: 0.25in">*<br>
		Student Last Name:<input type="TEXT" name="StudentLastName[]" required="1" size="20" style="width: 6.0in; height: 0.25in">*<br>
        Student Device ID:<input type="TEXT" name="Device[]"  size="20" style="width: 5.75in; height: 0.25in"><br />
        Student Password:<input type="TEXT" name="Password[]" size="20" style="width: 5.75in; height: 0.25in"><br />
        <br />
    </span>
    <p><b>Results:</b><span id="results"> </span></p>
    </form>
    <script language="JavaScript">
    </script>
</body>
</html>
